#元组

#1、有序项目集合
#2、可以存放任何数据类型对象
#3、不可变数据类型

# t1 = ()
# type(t1)
# Out[3]: tuple
# t1 = (1)
# type(t1)
# Out[5]: int
# t1 = (1,)
# type(t1)
# Out[7]: tuple
# tuple("abc")
# Out[8]: ('a', 'b', 'c')
# list( tuple("abc") )
# Out[9]: ['a', 'b', 'c']
# t1 = ("abc", None, False,1,3.4)
# t1[0]
# Out[11]: 'abc'
# t1[0] = "xyz"
# Traceback (most recent call last):
#   File "D:\python38\lib\site-packages\IPython\core\interactiveshell.py", line 3397, in run_code
#     exec(code_obj, self.user_global_ns, self.user_ns)
#   File "<ipython-input-12-5bd21952e310>", line 1, in <cell line: 1>
#     t1[0] = "xyz"
# TypeError: 'tuple' object does not support item assignment

#元组中存放可变数据类型元素的时候，那这个元素是可以改变的
# t1 = ("abc", 3, 4.5, [1,2])
# t1[3]
# Out[14]: [1, 2]
# t1[3].append("x")
# t1
# Out[16]: ('abc', 3, 4.5, [1, 2, 'x'])